using System;
using ch.ethz.ssh2;
namespace ch.ethz.ssh2.packets
{
	
	/// <summary> PacketKexDhGexRequest.
	/// 
	/// </summary>
	/// <author>  Christian Plattner
	/// </author>
	/// <version>  2.50, 03/15/10
	/// </version>
	public class PacketKexDhGexRequest
	{
		virtual public byte[] Payload
		{
			get
			{
				if (payload == null)
				{
					TypesWriter tw = new TypesWriter();
					tw.writeByte(Packets.SSH_MSG_KEX_DH_GEX_REQUEST);
					tw.writeUINT32(min);
					tw.writeUINT32(n);
					tw.writeUINT32(max);
					payload = tw.getBytes();
				}
				return payload;
			}
			
		}
		internal byte[] payload;
		
		internal int min;
		internal int n;
		internal int max;
		
		public PacketKexDhGexRequest(DHGexParameters para)
		{
			this.min = para.Min_group_len;
			this.n = para.Pref_group_len;
			this.max = para.Max_group_len;
		}
	}
}